import request from '@/router/axios';
import {
  curApp
} from '@/config/env';
export function GetMenu() {
  return request({
    url: '/clientauth/menu/userMenu/' + curApp,
    method: 'get'
  });
}
export function fetchTree(query) {
  return request({
    url: '/clientauth/menu/allTree',
    method: 'get',
    params: query
  });
}

export function fetchTreeByAppId(appId) {
  return request({
    url: '/clientauth/menu/getTreeByAppId/' + appId,
    method: 'get'
  });
}

export function addObj(obj) {
  return request({
    url: '/clientauth/menu/',
    method: 'post',
    data: obj
  });
}

export function getObj(id) {
  return request({
    url: '/clientauth/menu/' + id,
    method: 'get'
  });
}

export function delObj(id) {
  return request({
    url: '/clientauth/menu/' + id,
    method: 'delete'
  });
}

export function putObj(obj) {
  return request({
    url: '/clientauth/menu/',
    method: 'put',
    data: obj
  })
}
